home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_203 / examples / speechtoy / speechtoy.asm < prev    next >
Assembly Source File  |  1992-05-06  |  48KB  |  1,776 lines

  1.    XREF   _LVOAllocMem,_LVOFreeMem
  2.    XREF   _LVOFreeSignal,_LVOAllocSignal
  3.    XREF   _LVOOffGadget,_LVOOnGadget,_LVOAddGadget,_LVORemoveGadget
  4.    XREF   _LVOTranslate
  5.    XREF   _LVOAbortIO,_LVOSendIO,_LVODoIO
  6.    XREF   _LVOAutoRequest
  7.    XREF   _LVOWaitBOVP
  8.    XREF   _LVODisplayBeep
  9.    XREF   _LVOReplyMsg,_LVOGetMsg,_LVOPutMsg,_LVOWait
  10.    XREF   _LVOSetMenuStrip
  11.    XREF   _LVORefreshGadgets
  12.    XREF   _LVORectFill,_LVOMove,_LVODraw,_LVOText
  13.    XREF   _LVOSetAPen
  14.    XREF   _LVOOpenWindow,_LVOCloseWindow
  15.    XREF   _LVOFindTask
  16.    XREF   _LVOOpenDevice,_LVOCloseDevice
  17.    XREF   _LVOOpenLibrary,_LVOCloseLibrary
  18.  
  19.    XREF   _SysBase,_DOSBase,_exit  ;from StartUp.o
  20.  
  21. ; This program is probably copyright Commodore-Amiga.  It was mailed
  22. ; to me directly by Bruce Barrett at Commodore-Amiga in response to a
  23. ; to a question about a previous version's copyright status.  I
  24. ; therefore assume that it is Commodore-Amiga's intention that this
  25. ; program be freely redistributable.  Fred Fish, 3-Jan-86.
  26. ;
  27. ; This program was written to show the use of gadgets in a
  28. ; window. Thus one menu, one auto requester, but lots of gadget types.
  29. ; For the sake of example, two mutual exclude gadgets
  30. ; (female/male) are shown that perform a function that might
  31. ; be better implemented as a toggle image, in a manner similar
  32. ; to that shown in the inflection Mode gadget.
  33. ; Again for the sake of example, the proportional gadgets
  34. ; are generated dynamicly (that is, copied from a template and
  35. ; filled in), whereas most gadgets are declared staticly in
  36. ; the struct declaration, which saves the initialization code space.
  37. ; Lastly, for the sake of example, this program is extremely
  38. ; verbose in the way of comments. Hope you don't mind.
  39. ;
  40. ; Written by David M Lucas.
  41.  
  42. ; Pen numbers to draw gadget borders/images/text with
  43. ;REDP equ  3        ; color in register 3 once was red
  44. ;BLKP equ  2        ; color in register 2 was black
  45. ;WHTP equ  1        ; color in register 1 was white
  46. ;BLUP equ  0        ; color in register 0 was blue
  47.  
  48.    XDEF   open_libs
  49. open_libs:
  50.        movea.l  _SysBase,a6
  51. ;-------Open Intuition--------
  52.        moveq    #33,d0            ;VERSION #33
  53.        lea      IntuitionTitle,a1
  54.        jsr      _LVOOpenLibrary(a6)
  55.        move.l   d0,_IntuitionBase
  56.        beq.s    errLib
  57. ;----Open Graphics--------
  58.        moveq    #33,d0            ;VERSION #33
  59.        lea      GraphicsTitle,a1
  60.        jsr      _LVOOpenLibrary(a6)
  61.        move.l   d0,_GfxBase
  62.        beq.s    errLib
  63. ;----Open Graphics--------
  64.        moveq    #33,d0            ;VERSION #33
  65.        lea      TranslatorTitle,a1
  66.        jsr      _LVOOpenLibrary(a6)
  67.        move.l   d0,_TranslatorBase
  68. errLib rts
  69.  
  70.    XDEF   _main
  71. _main:
  72.     link     a5,#-14
  73. ;=======Open those libraries that the program uses directly======
  74.     bsr.s    open_libs
  75.     bne.s    OP
  76. .7  bsr      exit_program     ;never returns
  77. ;=======Open the Narrator Device========
  78. OP  lea      VoiceIOB,a1
  79.     movea.l  a1,a2
  80.     moveq    #0,d0
  81.     moveq    #0,d1
  82.     lea      Narrator,a0
  83.     jsr      _LVOOpenDevice(a6)
  84.     move.b   d0,_NarratorOpenError
  85.     bne.s    .7
  86. ;=====Copy the VoiceIOB defaults to MouthIO, and initialize a few fields=====
  87.     lea      MouthIO,a0
  88.     movea.l  a0,a1
  89.     moveq    #17-1,d0
  90. cpy move.l   (a2)+,(a0)+
  91.     Dbra     d0,cpy
  92.     move.w   (a2),(a0)
  93.   ;----Store the address of ReadPort
  94.     move.l   #ReadPort,14(a1)
  95.   ;----Change the Command to CMD_READ (instead of CMD_WRITE)
  96.     move.w   #2,28(a1)
  97. ;======Now allocate memory accessable by the chips for images======
  98.     bsr      get_chip_mem
  99.     beq.s    .7
  100. ;=======Allocate signals/setup Talk and Read ports=========
  101.     moveq    #-1,d0
  102.     movea.l  _SysBase,a6
  103.     jsr      _LVOAllocSignal(a6)
  104.     move.b   d0,TalkPort+15
  105.     bmi.s    .7
  106.     suba.l   a1,a1
  107.     jsr      _LVOFindTask(a6)
  108.     move.l   d0,TalkPort+16
  109.     move.l   d0,ReadPort+16
  110.     moveq    #-1,d0
  111.     jsr      _LVOAllocSignal(a6)
  112.     move.b   d0,ReadPort+15
  113.     bmi.s    .7
  114. ;========Open the ControlWindow===========
  115.     movea.l  _IntuitionBase,a6
  116.     move.l   _FaceWindow,d0
  117.     bne.s    .49
  118. ;----------Open the Window----------------
  119.     lea      _NewControlWindow,a0
  120.     jsr      _LVOOpenWindow(a6)
  121.     move.l   d0,_ControlWindow
  122.     beq      .7
  123.     movea.l  d0,a0
  124.     move.l   50(a0),RastPort
  125. ;-----Attach Menu Strip to window---------
  126.     ;WindowPtr in a0
  127.     lea      Menu0,a1
  128.     jsr      _LVOSetMenuStrip(a6)
  129. ;=======fill background of window=========
  130. .49 moveq    #2,d0
  131.     movea.l  RastPort,a1
  132.     movea.l  _GfxBase,a6
  133.     jsr      _LVOSetAPen(a6)
  134.     movea.l  _ControlWindow,a0
  135.     moveq    #0,d3
  136.     move.w   114(a0),d3
  137.     moveq    #0,d2
  138.     move.w   112(a0),d2
  139.     moveq    #0,d1
  140.     moveq    #0,d0
  141.     movea.l  50(a0),a1
  142.     jsr      _LVORectFill(a6)
  143.  ;----RefreshGadgets
  144.     suba.l   a2,a2
  145.     movea.l  _ControlWindow,a1
  146.     lea      PropGadget3,a0
  147.     movea.l  _IntuitionBase,a6
  148.     jsr      _LVORefreshGadgets(a6)
  149. ;====================IDCMP MAIN LOOP==============================
  150. ;---Wait for a message sent to ControlWindow's, FaceWindow's, VoiceIOB's
  151. ;   (TalkPort), or MouthIO's (ReadPort) message port
  152. .53 move.l   _ControlWindow,a0
  153.     move.l   86(a0),a1
  154.     moveq    #0,d0
  155.     move.b   15(a1),d1
  156.     Bset.l   d1,d0
  157.     move.l   _FaceWindow,a0
  158.     move.l   86(a0),a1
  159.     move.b   15(a1),d1
  160.     Bset.l   d1,d0
  161.     movea.l  VoiceIOB+14,a0
  162.     move.b   15(a0),d1
  163.     Bset.l   d1,d0
  164.     movea.l  MouthIO+14,a0
  165.     move.b   15(a0),d1
  166.     Bset.l   d1,d0
  167.     movea.l  _SysBase,a6
  168.     jsr      _LVOWait(a6)
  169.     move.l   d0,-4(a5)
  170. ;================now check to see to what we owe the intrusion========
  171.   ;---Check for message from ControlWindow
  172.     move.l   _ControlWindow,a0
  173.     move.l   86(a0),a1
  174.     move.b   15(a1),d1
  175.     Bclr.l   d1,d0
  176.     beq      .54
  177.   ;----Get the message
  178. .55 movea.l  _ControlWindow,a1
  179.     movea.l  86(a1),a0
  180.     movea.l  _SysBase,a6
  181.     jsr      _LVOGetMsg(a6)
  182.     move.l   d0,_MyIntuiMessage
  183.     beq.s    .54
  184.   ;-----Get all the needed info and give message back
  185.     movea.l  d0,a1
  186.     move.l   20(a1),-(sp)     ;Class
  187.     move.w   24(a1),-10(a5)   ;Code
  188.     move.l   28(a1),-14(a5)   ;IAddress
  189.     jsr      _LVOReplyMsg(a6)
  190.     move.l   (sp)+,d0
  191.     sub.l    #64,d0
  192.     beq.s    .60
  193.     sub.l    #192,d0
  194.     beq.s    .59
  195.     sub.l    #256,d0
  196.     bne.s    .64
  197. ;================case CLOSEWINDOW:================
  198.   ;---Empty the window's message port
  199. .61 movea.l  _SysBase,a6
  200. .LL movea.l  _ControlWindow,a1
  201.     movea.l  86(a1),a0
  202.     jsr      _LVOGetMsg(a6)
  203.     move.l   d0,d1
  204.     beq      .7
  205.     move.l   d0,a1
  206.     jsr      _LVOReplyMsg(a6)
  207.     bra.s    .LL
  208. ;===============case MENUPICK:===================
  209. .59 movea.l  _ControlWindow,a0
  210.     move.w   -10(a5),d0
  211.     bsr      handle_menu
  212.     bra.s    .55
  213. ;==============case GADGETUP: reply, then process==========
  214. .60 movea.l  -14(a5),a1
  215.     bsr      handle_up
  216.     bra      .55
  217. ;=================default:==================
  218. .64 bra      .55
  219. ;=======Check for activity in FaceWindow=============
  220. .54 movea.l  _FaceWindow,a0
  221.     movea.l  86(a0),a1
  222.     move.b   15(a1),d1
  223.     move.l   -4(a5),d0
  224.     Bclr.l   d1,d0
  225.     beq.s    .65
  226. .66 movea.l  _FaceWindow,a1
  227.     movea.l  86(a1),a0
  228.     movea.l  _SysBase,a6
  229.     jsr      _LVOGetMsg(a6)
  230.     move.l   d0,_MyIntuiMessage
  231.     beq.s    .65
  232.     move.l   d0,a1
  233.     move.l   20(a1),d0
  234.     subq.l   #1,d0
  235.     beq.s    .70
  236.     subq.l   #1,d0
  237.     beq.s    .72
  238.     sub.l    #254,d0
  239.     bne.s    .73
  240. ;===============case MENUPICK:================
  241. .71 movea.l  _FaceWindow,a0
  242.     move.w   24(a1),d0
  243.     bsr      handle_menu
  244.    ; bra.s    .70
  245. ;===============case SIZEVERIFY:==============
  246. .70:
  247. ;===============DEFAULT:=====================
  248. .73 movea.l  _MyIntuiMessage,a1
  249.     movea.l  _SysBase,a6
  250.     jsr      _LVOReplyMsg(a6)
  251.     bra.s    .66
  252. ;==============case NEWSIZE: Don't reply until processed=======
  253. .72 bsr      draw_face
  254.     bra.s    .70
  255. ;=============A voice SendIO (Write) has completed============
  256. .65 movea.l  _IntuitionBase,a6
  257.     move.l   VoiceIOB+14,a0
  258.     move.b   15(a0),d1
  259.     move.l   -4(a5),d0
  260.     Bclr.l   d1,d0
  261.     beq      .74
  262. ;======Was it Sucessful? filter out the abort error======
  263.     cmpi.b   #-2,VoiceIOB+31
  264.     bne.s    .75
  265.     clr.b    VoiceIOB+31
  266.   ;----Check for error
  267. .75 move.b   VoiceIOB+31,d0
  268.     beq      .76
  269.   ;-----flash this screen, if error
  270.     movea.l  _ControlWindow,a1
  271.     movea.l  46(a1),a0
  272.     jsr      _LVODisplayBeep(a6)
  273.   ;=====let user see where phoneme string was bad.
  274.   ;------Remove PhonStrGadget
  275.     lea      _PhonStrGadget,a1
  276.     movea.l  _ControlWindow,a0
  277.     jsr      _LVORemoveGadget(a6)
  278.     move.w   d0,_i
  279. ;move the cursor to the error char
  280. ;PhonInfo.BufferPos = VoiceIOB's message.io_Actual -1
  281.     move.l   VoiceIOB+32,d0
  282.     subq.l   #1,d0
  283.     move.w   d0,_PhonInfo+8
  284. ; assure cursor (error point) is shown in gad.
  285. ; within 29 (number of chars shown) of front
  286. ;if (VoiceIOB's message.io_Actual < 29)
  287. ;PhonInfo.DispPos = 0
  288. ;within 29 of end
  289.     cmpi.l   #29,VoiceIOB+32
  290.     bcc.s    .77
  291.     clr.w    _PhonInfo+12
  292.     bra.s    .78
  293. ;else if ((VoiceIOB's message.io_Length -
  294. ;VoiceIOB's message.io_Actual) < 29)
  295. ;PhonInfo.DispPos = VoiceIOB's message.io_Length
  296. .77 move.l   VoiceIOB+36,d0
  297.     move.l   d0,d1
  298.     sub.l    VoiceIOB+32,d0
  299.     cmpi.l   #29,d0
  300.     bcc.s    .79
  301.     subi.l   #29,d1
  302.     move.w   d1,_PhonInfo+12
  303.     bra.s    .78
  304. ;PhonInfo.DispPos = VoiceIOB's message.io_Actual - 15
  305. .79 move.l   VoiceIOB+32,d0
  306.     subi.l   #15,d0
  307.     move.w   d0,_PhonInfo+12
  308.   ;------Add PhonStrGadget
  309. .78 moveq    #0,d0
  310.     move.w   _i,d0
  311.     lea      _PhonStrGadget,a1
  312.     move.l   _ControlWindow,a0
  313.     jsr      _LVOAddGadget(a6)
  314.   ;------Refresh PhonStrGadget
  315.     suba.l   a2,a2
  316.     movea.l  _ControlWindow,a1
  317.     lea      _PhonStrGadget,a0
  318.     jsr      _LVORefreshGadgets(a6)
  319.   ;----VoiceIOB's message.io_Error = 0
  320.     clr.b    VoiceIOB+31
  321.   ;----Turn on SpeakGadget
  322. .76 suba.l   a2,a2
  323.     movea.l  _ControlWindow,a1
  324.     lea      _SpeakGadget,a0
  325.     jsr      _LVOOnGadget(a6)
  326.   ;----Turn on FaceGadget
  327.     suba.l   a2,a2
  328.     movea.l  _ControlWindow,a1
  329.     lea      _FaceGadget,a0
  330.     jsr      _LVOOnGadget(a6)
  331. ;==============A mouth DoIO (Read) has completed=============
  332. .74 movea.l  MouthIO+14,a0
  333.     move.l   -4(a5),d0
  334.     move.b   15(a0),d1
  335.     Bclr.l   d1,d0
  336.     beq      .53
  337.   ;
  338.     movea.l  _GfxBase,a6
  339.     movea.l  _FaceWindow,a0
  340.     move.l   46(a0),a1          ;face window's screen
  341.     lea      44(a1),a0          ;screen's viewport
  342.     jsr      _LVOWaitBOVP(a6)
  343.   ;----Set ForePen to white
  344.     movea.l  _FaceWindow,a0
  345.     movea.l  50(a0),a1
  346.     moveq    #1,d0
  347.     jsr      _LVOSetAPen(a6)
  348. ;RectFill(FaceWindow->RPort, 0, EyesBottom,
  349. ;Window's GZZWidth, Window's GZZHeight)
  350.     movea.l  _FaceWindow,a0
  351.     moveq    #0,d3
  352.     move.w   114(a0),d3
  353.     moveq    #0,d2
  354.     move.w   112(a0),d2
  355.     moveq    #0,d1
  356.     move.w   _EyesBottom,d1
  357.     moveq    #0,d0
  358.     movea.l  50(a0),a1
  359.     jsr      _LVORectFill(a6)
  360. ;if (MouthWMult == 0)
  361. ;LipWidth = mouth_io.width >> 1
  362.     move.w   _MouthWMult,d1
  363.     bne.s    .82
  364.     moveq    #0,d0
  365.     move.b   MouthIO+70,d0
  366.     lsr.b    #1,d0
  367.     move.w   d0,_LipWidth
  368.     bra.s    .83
  369. ;LipWidth = mouth_io.width * MouthWMult
  370. .82 moveq    #0,d0
  371.     move.b   MouthIO+70,d0
  372.     mulu     d1,d0
  373.     move.w   d0,_LipWidth
  374. ;if (MouthHMult == 0)
  375. ;LipHeight = mouth_io.height >> 1
  376. .83 move.w   _MouthHMult,d1
  377.     bne.s    .84
  378.     moveq    #0,d0
  379.     move.b   MouthIO+71,d0
  380.     lsr.b    #1,d0
  381.     move.w   d0,_LipHeight
  382.     bra.s    .85
  383. ;LipHeight = mouth_io.height * (MouthHMult)
  384. .84 moveq    #0,d0
  385.     move.b   MouthIO+71,d0
  386.     mulu     d1,d0
  387.     move.w   d0,_LipHeight
  388.   ;----Set ForePen to Red
  389. .85 movea.l  _FaceWindow,a0
  390.     movea.l  50(a0),a1
  391.     moveq    #3,d0
  392.     jsr      _LVOSetAPen(a6)
  393. ;----Move to one corner of the mouth
  394.     moveq    #0,d1
  395.     move.w   _YMouthCenter,d1
  396.     moveq    #0,d0
  397.     move.w   _XMouthCenter,d0
  398.     sub.w    _LipWidth,d0
  399.     movea.l  _FaceWindow,a0
  400.     movea.l  50(a0),a1
  401.     jsr      _LVOMove(a6)
  402. ;======DRAW THE 4 LINE SEGMENTS THAT COMPRISE THE (OPEN) MOUTH=======
  403.     moveq    #0,d1
  404.     move.w   _YMouthCenter,d1
  405.     sub.w    _LipHeight,d1
  406.     moveq    #0,d0
  407.     move.w   _XMouthCenter,d0
  408.     movea.l  _FaceWindow,a0
  409.     movea.l  50(a0),a1
  410.     jsr      _LVODraw(a6)
  411.     moveq    #0,d1
  412.     move.w   _YMouthCenter,d1
  413.     moveq    #0,d0
  414.     move.w   _XMouthCenter,d0
  415.     add.w    _LipWidth,d0
  416.     movea.l  _FaceWindow,a0
  417.     movea.l  50(a0),a1
  418.     jsr      _LVODraw(a6)
  419.     moveq    #0,d1
  420.     move.w   _YMouthCenter,d1
  421.     add.w    _LipHeight,d1
  422.     moveq    #0,d0
  423.     move.w   _XMouthCenter,d0
  424.     movea.l  _FaceWindow,a0
  425.     movea.l  50(a0),a1
  426.     jsr      _LVODraw(a6)
  427.     moveq    #0,d1
  428.     move.w   _YMouthCenter,d1
  429.     moveq    #0,d0
  430.     move.w   _XMouthCenter,d0
  431.     sub.w    _LipWidth,d0
  432.     movea.l  _FaceWindow,a0
  433.     movea.l  50(a0),a1
  434.     jsr      _LVODraw(a6)
  435. ;the narrator will give an error when the write has completed and I've tried
  436. ;to read. I stop trying when that happens.
  437.     lea      MouthIO,a1
  438.     move.b   31(a1),d0  ;check io_Error
  439.     bne      .53
  440.     movea.l  _SysBase,a6
  441.     jsr      _LVOSendIO(a6)
  442.     bra      .53
  443.  
  444. ;======================================================
  445. ; This handles the MENUpick. Since only 1 menu/subitem, make sure that
  446. ; menu # and item # are 0.
  447. ;
  448. ;handle_menu(code, w)
  449. ;            d0   a0
  450.  
  451.    XDEF   handle_menu
  452. handle_menu:
  453.     move.w   d0,d1
  454.     andi.w   #$1F,d0
  455.     bne.s    .92
  456.     movem.l  d2/d3/a2/a3,-(sp)
  457.     lsr.w    #5,d1
  458.     andi.w   #$3F,d1
  459.     bne.s    .92
  460.     moveq    #47,d3
  461.     moveq    #0,d2
  462.     move.b   #280,d2
  463.     moveq    #0,d1
  464.     moveq    #0,d0
  465.     lea      _OKIText,a3
  466.     suba.l   a2,a2
  467.     lea      _ReqText3,a1
  468.     movea.l  _IntuitionBase,a6
  469.     jsr      _LVOAutoRequest(a6)
  470.     movem.l  (sp)+,d2/d3/a2/a3
  471. .92 rts
  472.  
  473. ;====================================================
  474. ; Handles a GADGETUP message.
  475. ;
  476. ;gadgetmessage(IAddress)
  477. ;                 a1
  478.  
  479.    XDEF   handle_up
  480. handle_up:
  481. ;==========DECODE WHICH GADGET WAS SELECTED========
  482.      lea      _FaceGadget,a0
  483.      cmpa.l   a0,a1
  484.      beq      FACE
  485.      lea      _StopGadget,a0
  486.      cmpa.l   a0,a1
  487.      beq      STOP
  488.      lea      _FemaleGadget,a0
  489.      cmpa.l   a0,a1
  490.      beq      FMG
  491.      lea      _MaleGadget,a0
  492.      cmpa.l   a0,a1
  493.      beq      MG
  494.      lea      _TranslateGadget,a0
  495.      cmpa.l   a0,a1
  496.      beq      TRAN
  497.      lea      _SpeakGadget,a0
  498.      cmpa.l   a0,a1
  499.      beq      SPK
  500.      lea      PropGadget0,a0
  501.      cmpa.l   a0,a1
  502.      beq      PRP0
  503.      lea      PropGadget1,a0
  504.      cmpa.l   a0,a1
  505.      beq      PRP1
  506.      lea      PropGadget2,a0
  507.      cmpa.l   a0,a1
  508.      beq      PRP2
  509.      lea      PropGadget3,a0
  510.      cmpa.l   a0,a1
  511.      beq      PRP3
  512.      lea      _ModeGadget,a0
  513.      cmpa.l   a0,a1
  514.      bne      .137
  515.  ;ignore the _EnglStrGadget and _PhonStrGadget
  516. ;==============ModeGadget===================
  517.    ;----if ModeGadget's Flags = SELECTED, then voiceIOB's mode = ROBOTIC0
  518.      moveq    #1,d1
  519.      move.b   13(a0),d0
  520.      bmi.s    .101
  521.    ;----Otherwise, mode = NATURALF0
  522.      moveq    #0,d1
  523. .101 move.w   d1,VoiceIOB+52
  524.      rts
  525. ;=============FaceGadget===============
  526.    ;----if FaceGadget's Flags = SELECTED, then open it. Otherwise, close it.
  527. FACE movea.l  _IntuitionBase,a6
  528.      move.b   13(a0),d0
  529.      bpl.s    .105
  530.     ;---VoiceIOB's mouths = 1
  531.      move.b   #1,VoiceIOB+66  ;indicate that reads will be forthcoming
  532.     ;----Open the FaceWindow
  533.      lea      _NewFaceWindow,a0
  534.      jsr      _LVOOpenWindow(a6)
  535.      move.l   d0,_FaceWindow
  536.      bne.s    .106
  537.      bsr      exit_program
  538.    ;----Attach the menu to the FaceWindow
  539. .106 lea      Menu0,a1
  540.      movea.l  d0,a0
  541.      jsr      _LVOSetMenuStrip(a6)
  542.    ;----Draw the face in the opened FaceWindow
  543.      bsr      draw_face
  544.      rts
  545.    ;----FaceGadget was DESELECTED, so it must now be closed.
  546.     ;-----VoiceIOB's mouths = 0
  547. .105 clr.b    VoiceIOB+66
  548.     ;---Store last Left, Top, Width, and Height for next open
  549.      move.l   _FaceWindow,a0
  550.      lea      _NewFaceWindow,a1
  551.      move.w   4(a0),(a1)
  552.      move.w   6(a0),2(a1)
  553.      move.w   8(a0),4(a1)
  554.      move.w   10(a0),6(a1)
  555.      jsr      _LVOCloseWindow(a6)
  556.      clr.l    _FaceWindow
  557.      rts
  558. ;==========StopGadget==============
  559.   ;----Abort the IO
  560. STOP lea     VoiceIOB,a1
  561.      movea.l _SysBase,a6
  562.      jsr     _LVOAbortIO(a6)
  563.   ;----reset VoiceIOB's message.io_Error
  564.      clr.b   VoiceIOB+31
  565.   ;----reset mouth_io.voice.message.io_Error
  566.      clr.b   MouthIO+31
  567.      rts
  568. ;=========FemaleGadget===============
  569. ; Since this program changes a flag that intuition expects
  570. ; only the user to change (SELECTED bit), this program has
  571. ; to remove, then change, then add this gadget. Then by
  572. ; passing the address of this gadget to RefreshGadgets(),
  573. ; only the gadgets from here to the start of the list will
  574. ; be refreshed, which minimizes the visible flash that
  575. ; RefreshGadgets() can introduce.
  576. ; If one of the two gadgets (female/male) is hit, toggle
  577. ; the selection of the other gadget (since the gadget hit
  578. ; was toggled by intuition when it was hit).
  579.   ;----if FemaleGadget's Flags = SELECTED, then VoiceIOB's sex = FEMALE
  580. FMG  movea.l  _IntuitionBase,a6
  581.      moveq    #1,d1
  582.      move.b   13(a0),d0
  583.      bmi.s    .112
  584.    ;---Otherwise VoiceIOB's sex = MALE
  585.      moveq    #0,d1
  586. .112 move.w   d1,VoiceIOB+54
  587.    ;----Remove the MaleGadget
  588.      lea      _MaleGadget,a1
  589.      move.l   _ControlWindow,a0
  590.      jsr      _LVORemoveGadget(a6)
  591.    ;----MaleGadget's Flags = SELECTED
  592.      Bchg.b   #7,_MaleGadget+13
  593.    ;-----Add the MaleGadget
  594.      lea      _MaleGadget,a1
  595.      move.l   _ControlWindow,a0
  596.      jsr      _LVOAddGadget(a6)
  597.    ;-----Refresh the MaleGadget
  598. REF  suba.l   a2,a2
  599.      movea.l  _ControlWindow,a1
  600.      lea      _MaleGadget,a0
  601.      jsr      _LVORefreshGadgets(a6)
  602.      rts
  603. ;===============MaleGadget=============
  604.   ;----if MaleGadget's Flags = SELECTED, then VoiceIOB's sex = MALE
  605. MG   movea.l  _IntuitionBase,a6
  606.      moveq    #0,d1
  607.      move.b   13(a0),d0
  608.      bmi.s    .116
  609.    ;-----Otherwise, VoiceIOB's sex = FEMALE
  610.      moveq    #1,d1
  611. .116 move.w   d1,VoiceIOB+54
  612.    ;-----Remove the FemaleGadget
  613.      lea      _FemaleGadget,a1
  614.      move.l   _ControlWindow,a0
  615.      jsr      _LVORemoveGadget(a6)
  616.    ;----FemaleGadget's Flags = SELECTED
  617.      Bchg.b   #7,_FemaleGadget+13
  618.    ;----Add the FemaleGadget
  619.      lea      _FemaleGadget,a1
  620.      move.l   _ControlWindow,a0
  621.      jsr      _LVOAddGadget(a6)
  622.    ;---Refresh MaleGadget
  623.      bra.s    REF
  624. ;===========Check for TranslateGadget==============
  625. ;  Since the program changes the contents of the string
  626. ;  gadgets' buffer and it's size, which is something else
  627. ;  intuition doesn't expect a program (as opposed to the
  628. ;  user) to do. The program must remove, then change, then
  629. ;  add this gadget, and then by passing the address of this
  630. ;  gadget to RefreshGadgets(), only the gadgets from here
  631. ;  to the start of the list will be refreshed, which
  632. ;  minimizes the visible flash that RefreshGadgets() can introduce.
  633.    ;RemoveGadget the PhonStrGadget
  634. TRAN lea      _PhonStrGadget,a1
  635.      move.l   _ControlWindow,a0
  636.      movea.l  _IntuitionBase,a6
  637.      jsr      _LVORemoveGadget(a6)
  638.      move.w   d0,-(sp)
  639.      move.l   a6,-(sp)
  640.   ;---Translate the EnglBuffer and put it into the PhonBuffer
  641.      moveq    #0,d1
  642.      move.w   _PhonInfo+10,d1
  643.      lea      _PhonBuffer,a1
  644.      moveq    #0,d0
  645.      move.w   _EnglInfo+16,d0
  646.      lea      _EnglBuffer,a0
  647.      movea.l  _TranslatorBase,a6
  648.      jsr      _LVOTranslate(a6)
  649.      movea.l  (sp)+,a6
  650.      move.b   d0,_TranslatorError
  651.      beq.s    .120
  652.   ;----flash this screen if an error in translating
  653.      movea.l  _ControlWindow,a1
  654.      movea.l  46(a1),a0
  655.      jsr      _LVODisplayBeep(a6)
  656.   ; Hey! NumChars includes the terminating NULL.
  657.   ;/* This must be done. */
  658.   ;PhonInfo.NumChars = VoiceIOB's message.io_Length + 1
  659. .120 lea      VoiceIOB,a0
  660.      lea      _PhonInfo,a1
  661.      move.l   36(a0),d0
  662.      addq.l   #1,d0
  663.      move.w   d0,16(a1)
  664.   ;if (PhonInfo.DispPos > VoiceIOB's message.io_Length)
  665.   ;PhonInfo.DispPos = VoiceIOB's message.io_Length
  666.      move.w   12(a1),d0
  667.      sub.w    36(a0),d0
  668.      bls.s    .121
  669.      move.w   38(a0),12(a1)
  670.   ;AddGadget(ControlWindow, &PhonStrGadget, i)
  671. .121 moveq    #0,d0
  672.      move.w   (sp)+,d0
  673.      lea      _PhonStrGadget,a1
  674.      move.l   _ControlWindow,a0
  675.      jsr      _LVOAddGadget(a6)
  676.   ;----Refresh PhonStrGadget
  677.      suba.l   a2,a2
  678.      movea.l  _ControlWindow,a1
  679.      lea      _PhonStrGadget,a0
  680.      jsr      _LVORefreshGadgets(a6)
  681.      rts
  682. ;=================SpeakGadget=================
  683.   ;----Turn off the SpeakGadget
  684. SPK  movea.l  _IntuitionBase,a6
  685.      suba.l   a2,a2
  686.      movea.l  _ControlWindow,a1
  687.      lea      _SpeakGadget,a0
  688.      jsr      _LVOOffGadget(a6)
  689.   ;----Turn off the FaceGadget
  690.      suba.l   a2,a2
  691.      movea.l  _ControlWindow,a1
  692.      lea      _FaceGadget,a0
  693.      jsr      _LVOOffGadget(a6)
  694.    ;VoiceIOB's message.io_Length = # of chars in PhonBuffer
  695.      lea      _PhonBuffer,a0
  696.      move.l   a0,d0
  697. len  move.b   (a0)+,d1
  698.      bne.s    len
  699.      subq.l   #1,a0
  700.      suba.l   d0,a0
  701.      lea      VoiceIOB,a1
  702.      move.l   a0,36(a1)
  703.    ;----Send the IO
  704.      movea.l  _SysBase,a6
  705.      jsr      _LVOSendIO(a6)
  706.    ;----if VoiceIOB's mouths = 1
  707.      cmpi.b   #1,VoiceIOB+66
  708.      bne.s    .137
  709.    ;mouth_io's voice.message.io_Error = 0
  710.      lea      MouthIO,a1
  711.      clr.b    31(a1)
  712.    ;----Send the mouth IO
  713.      jsr      _LVOSendIO(a6)
  714.      rts
  715. ;===============Props[0]==============
  716.    ;-----PropRange = RNGFREQ
  717. PRP0 move.w   #23001,d1
  718.   ;VoiceIOB's sampfreq = (( (PropInfo[0].HorizPot >> 1)
  719.   ;* PropRange) >> 15) + MINFREQ
  720.      move.w   PropInfo0+2,d0
  721.      lsr.w    #1,d0
  722.      mulu     d1,d0
  723.      moveq    #15,d1
  724.      lsr.l    d1,d0
  725.      addi.w   #5000,d0
  726.      move.w   d0,VoiceIOB+64
  727.      rts
  728. ;==================Props[1]============
  729.    ;-----PropRange = RNGRATE
  730. ;VoiceIOB's rate = (((PropInfo[1].HorizPot >> 1)
  731. ;* PropRange) >> 15) + MINRATE
  732. PRP1 move.w   PropInfo1+2,d0
  733.      lsr.w    #1,d0
  734.      mulu     #361,d0
  735.      moveq    #15,d1
  736.      lsr.l    d1,d0
  737.      addi.w   #40,d0
  738.      move.w   d0,VoiceIOB+48
  739.      rts
  740. ;================Props[2]================
  741.   ;-----PropRange = RNGPITCH
  742.   ;VoiceIOB's pitch = (((PropInfo[2].HorizPot >> 1)
  743.   ;* PropRange) >> 15) + MINPITCH
  744. PRP2 move.w   PropInfo2+2,d0
  745.      lsr.w    #1,d0
  746.      mulu     #256,d0
  747.      moveq    #15,d1
  748.      lsr.l    d1,d0
  749.      addi.w   #65,d0
  750.      move.w   d0,VoiceIOB+50
  751.      rts
  752. ;================Props[3]================
  753.   ;----PropRange = RNGVOL
  754.   ;VoiceIOB's volume = (((PropInfo[3].HorizPot >> 1)
  755.   ;* PropRange) >> 15) + MINVOL
  756. PRP3 moveq    #65,d1
  757.      move.w   PropInfo3+2,d0
  758.      lsr.w    #1,d0
  759.      mulu     d1,d0
  760.      moveq    #15,d1
  761.      lsr.l    d1,d0
  762.      move.w   d0,VoiceIOB+62
  763. .137 rts
  764.  
  765. ;=============================================================
  766. ; This calculates variables used to draw the mouth and eyes, as well as
  767. ; redrawing the face. Proportionality makes it very wierd, but it's
  768. ; wierder if you don't use a GimmeZeroZero window and GZZWidth/GZZHeight.
  769.  
  770.    XDEF   draw_face
  771. draw_face:
  772.      movea.l  _FaceWindow,a0
  773. ;----set mouth center position based on size of window
  774.      move.w   112(a0),d0      ;Window's current width
  775.      lsr.w    #1,d0           ;divide by 2
  776.      move.w   d0,_XMouthCenter
  777. ;----set left edge position of left eye based on size of window
  778.      lsr.w    #1,d0
  779.      move.w   d0,_EyesLeft    ;width/4
  780. ;----multiplier for mouth width
  781. ;   MouthWMult = GZZWidth/16
  782.      lsr.w    #4,d0
  783.      move.w   d0,_MouthWMult
  784. ;EyesTop = GZZHeight/4 - GZZHeight/16
  785.      move.w   114(a0),d0      ;Window's current height
  786.      lsr.w    #2,d0           ;divide by 4
  787.      move.w   d0,d1
  788.      lsr.w    #2,d1           ;divide by 16
  789.      sub.w    d1,d0
  790.      move.w   d0,_EyesTop
  791. ;EyesBottom = EyesTop + (GZZHeight/8) + 1
  792.      move.w   114(a0),d0
  793.      move.w   d0,d1
  794.      lsr.w    #3,d0
  795.      add.w    _EyesTop,d0
  796.      addq.w   #1,d0
  797.      move.w   d0,_EyesBottom
  798. ;yaw = GZZHeight - EyesBottom
  799.      sub.w    _EyesBottom,d1
  800.      move.w   d1,_yaw
  801.      move.w   d1,d0
  802. ;YMouthCenter = (yaw/2) + EyesBottom
  803.      lsr.w    #1,d1
  804.      add.w    _EyesBottom,d1
  805.      move.w   d1,_YMouthCenter
  806. ;MouthHMult = yaw/32
  807.      lsr.w    #5,d0
  808.      move.w   d0,_MouthHMult
  809. ;==========Set ForePen to White=============
  810.      movea.l  _FaceWindow,a0
  811.      movea.l  50(a0),a1
  812.      movea.l  _GfxBase,a6
  813.      moveq    #1,d0
  814.      jsr      _LVOSetAPen(a6)
  815. ;---Fill the FaceWindow's background
  816.      movea.l  _FaceWindow,a0
  817.      moveq    #0,d3
  818.      move.w   114(a0),d3
  819.      moveq    #0,d2
  820.      move.w   112(a0),d2
  821.      moveq    #0,d1
  822.      moveq    #0,d0
  823.      movea.l  50(a0),a1
  824.      jsr      _LVORectFill(a6)
  825. ;=============Set ForePen to Blue============
  826.      movea.l  _FaceWindow,a0
  827.      movea.l  50(a0),a1
  828.      moveq    #0,d0
  829.      jsr      _LVOSetAPen(a6)
  830.  ;----Fill in the eyes
  831.      movea.l  _FaceWindow,a0
  832.      moveq    #0,d3
  833.      move.w   114(a0),d3
  834.      lsr.w    #3,d3
  835.      add.w    _EyesTop,d3
  836.      moveq    #0,d2
  837.      move.w   112(a0),d2
  838.      lsr.w    #3,d2
  839.      add.w    _EyesLeft,d2
  840.      moveq    #0,d1
  841.      move.w   _EyesTop,d1
  842.      moveq    #0,d0
  843.      move.w   _EyesLeft,d0
  844.      movea.l  50(a0),a1
  845.      jsr      _LVORectFill(a6)
  846.      movea.l  _FaceWindow,a0
  847.      moveq    #0,d2
  848.      move.w   112(a0),d2
  849.      lsr.w    #1,d2
  850.      move.l   d2,d0
  851.      move.w   d2,d1
  852.      lsr.w    #2,d1
  853.      add.w    d1,d2
  854.      add.w    d1,d2
  855.      add.w    d1,d0
  856.      moveq    #0,d1
  857.      move.w   _EyesTop,d1
  858.      moveq    #0,d3
  859.      move.w   114(a0),d3
  860.      lsr.w    #3,d3
  861.      add.w    d1,d3
  862.      movea.l  50(a0),a1
  863.      jsr      _LVORectFill(a6)
  864.   ;----Set ForePen to Red
  865.      movea.l  _FaceWindow,a0
  866.      movea.l  50(a0),a1
  867.      moveq    #3,d0
  868.      jsr      _LVOSetAPen(a6)
  869.   ;---draw the mouth (as a straight line - mouth not open)
  870.      moveq    #0,d0
  871.      move.w   _XMouthCenter,d0
  872.      movea.l  _FaceWindow,a0
  873.      move.w   112(a0),d1
  874.      lsr.w    #3,d1
  875.      sub.w    d1,d0
  876.      moveq    #0,d1
  877.      move.w   _YMouthCenter,d1
  878.      movea.l  50(a0),a1
  879.      jsr      _LVOMove(a6)
  880.      moveq    #0,d0
  881.      move.w   _XMouthCenter,d0
  882.      movea.l  _FaceWindow,a0
  883.      move.w   112(a0),d1
  884.      lsr.w    #3,d1
  885.      add.w    d1,d0
  886.      moveq    #0,d1
  887.      move.w   _YMouthCenter,d1
  888.      movea.l  50(a0),a1
  889.      jsr      _LVODraw(a6)
  890.      rts
  891.  
  892. ;============================================================
  893. ; Deallocate any memory, and close all of the windows/screens/devices/
  894. ; libraries in reverse order to make things work smoothly. And be sure to
  895. ; check that the open/allocation was successful before closing/deallocating.
  896.  
  897.    XDEF   exit_program
  898. exit_program:
  899.      movea.l  _SysBase,a6
  900. ;----Free the read_port signal
  901.      moveq    #0,d0
  902.      move.b   ReadPort+15,d0
  903.      bmi.s    .143
  904.      jsr      _LVOFreeSignal(a6)
  905. ;-----Free the talk_port signal
  906. .143 moveq    #0,d0
  907.      move.b   TalkPort+15,d0
  908.      bmi.s    .144
  909.      jsr      _LVOFreeSignal(a6)
  910. ;----Close the FaceWindow
  911. .144 movea.l  _IntuitionBase,a6
  912.      move.l   _FaceWindow,d0
  913.      beq.s    .145
  914.      movea.l  d0,a0
  915.      jsr      _LVOCloseWindow(a6)
  916. .145 move.l   _ControlWindow,d0
  917.      beq.s    .146
  918.      movea.l  d0,a0
  919.      jsr      _LVOCloseWindow(a6)
  920. ;-------freeimages makes sure image allocation was successful
  921. .146 bsr      free_chip_mem
  922. ;----Close the narrator device
  923.      move.b   _NarratorOpenError,d0
  924.      bne.s    .147
  925.      lea      VoiceIOB,a1
  926.      jsr      _LVOCloseDevice(a6)
  927. ;---Close Whichever Libs are Open
  928. .147 move.l   _TranslatorBase,d0
  929.      beq.s    .148
  930.      movea.l  d0,a1
  931.      jsr      _LVOCloseLibrary(a6)
  932. .148 move.l   _GfxBase,d0
  933.      beq.s    .149
  934.      movea.l  d0,a1
  935.      jsr      _LVOCloseLibrary(a6)
  936. .149 move.l   _IntuitionBase,d0
  937.      beq.s    .150
  938.      movea.l  d0,a1
  939.      jsr      _LVOCloseLibrary(a6)
  940. .150 clr.l    -(sp)
  941.      jsr      _exit    ;exits
  942.  
  943. ;=====================================================================
  944. ; Allocate chip memory for gadget images, and set the
  945. ; pointers in the corresponding image structures to point
  946. ; to these images. This must be done because the program
  947. ; could be loaded into expansion memory (off the side of
  948. ; the box), which the custom chips cannot access.
  949. ; And images must be in chip ram (that's memory that the
  950. ; custom chips can access, the internal 512K).
  951. ; Allocate them all, stop and return false on failure.
  952.  
  953.    XDEF   get_chip_mem
  954. get_chip_mem:
  955. ;----Allocate chip mem to copy FemaleData
  956.      moveq    #2,d1            ;MEMF_CHIP
  957.      moveq    #40,d0           ;# of Bytes
  958.      movea.l  _SysBase,a6
  959.      jsr      _LVOAllocMem(a6)
  960.      move.l   d0,_FemaleImage+10
  961.      beq      .155
  962. ;----Copy initialized FemaleIData to chip mem block
  963.      lea      _FemaleIData,a0
  964.      movea.l  d0,a1
  965.      moveq    #20-1,d0
  966. .163 move.w   (a0)+,(a1)+
  967.      Dbra     d0,.163
  968. ;----Allocate chip mem to copy MaleData
  969.      moveq    #2,d1            ;MEMF_CHIP
  970.      moveq    #40,d0           ;# of Bytes
  971.      jsr      _LVOAllocMem(a6)
  972.      move.l   d0,_MaleImage+10
  973.      beq.s    .155
  974. ;----Copy initialized MaleIData to chip mem block
  975.      lea      _MaleIData,a0
  976.      movea.l  d0,a1
  977.      moveq    #20-1,d0
  978. .164 move.w   (a0)+,(a1)+
  979.      Dbra     d0,.164
  980. ;----Allocate chip mem to copy HumanData
  981.      moveq    #2,d1
  982.      moveq    #120,d0
  983.      jsr      _LVOAllocMem(a6)
  984.      move.l   d0,_HumanImage+10
  985.      beq.s    .155
  986. ;----Copy initialized HumanIData to chip mem block
  987.      lea      _HumanIData,a0
  988.      movea.l  d0,a1
  989.      moveq    #60-1,d0
  990. .169 move.w   (a0)+,(a1)+
  991.      Dbra     d0,.169
  992. ;----Allocate chip mem to copy RobotData
  993.      moveq    #2,d1
  994.      moveq    #120,d0
  995.      jsr      _LVOAllocMem(a6)
  996.      move.l   d0,_RobotImage+10
  997.      beq.s    .155
  998. ;----Copy initialized RobotIData to chip mem block
  999.      lea      _RobotIData,a0
  1000.      movea.l  d0,a1
  1001.      moveq    #60-1,d0
  1002. .168 move.w   (a0)+,(a1)+
  1003.      Dbra     d0,.168
  1004. ;----Allocate (Zeroed) chip mem for FaceData
  1005.      move.l   #$10002,d1
  1006.      moveq    #60,d0
  1007.      jsr      _LVOAllocMem(a6)
  1008.      move.l   d0,_FaceImage+10
  1009.      beq.s    .155
  1010. ;----Allocate (ZEROED) chip mem for StopData
  1011.      move.l   #$10002,d1
  1012.      moveq    #60,d0
  1013.      jsr      _LVOAllocMem(a6)
  1014.      move.l   d0,_StopImage+10
  1015.      beq.s    .155
  1016.      moveq    #1,d0
  1017. .155 rts
  1018.  
  1019. ;========================================================
  1020. ; Deallocate the memory that was used for images, if pointers are not 0.
  1021.  
  1022.    XDEF   free_chip_mem
  1023. free_chip_mem:
  1024.      movea.l  _SysBase,a6
  1025.      move.l   _RobotImage+10,d1
  1026.      beq.s    .181
  1027.      moveq    #120,d0
  1028.      movea.l  d1,a1
  1029.      jsr      _LVOFreeMem(a6)
  1030. .181 move.l   _HumanImage+10,d1
  1031.      beq.s    .182
  1032.      moveq    #120,d0
  1033.      movea.l  d1,a1
  1034.      jsr      _LVOFreeMem(a6)
  1035. .182 move.l   _MaleImage+10,d1
  1036.      beq.s    .183
  1037.      moveq    #40,d0
  1038.      movea.l  d1,a1
  1039.      jsr      _LVOFreeMem(a6)
  1040. .183 move.l   _FemaleImage+10,d1
  1041.      beq.s    .184
  1042.      moveq    #40,d0
  1043.      movea.l  d1,a1
  1044.      jsr      _LVOFreeMem(a6)
  1045. .184 move.l   _FaceImage+10,d1
  1046.      beq.s    .185
  1047.      moveq    #60,d0
  1048.      movea.l  d1,a1
  1049.      jsr      _LVOFreeMem(a6)
  1050. .185 move.l   _StopImage+10,d1
  1051.      beq.s    .186
  1052.      moveq    #60,d0
  1053.      movea.l  d1,a1
  1054.      jsr      _LVOFreeMem(a6)
  1055. .186 rts
  1056.  
  1057.    XDEF   TextAttr
  1058. TextAttr:
  1059.    dc.l   TopazName
  1060.    dc.w   8       ;TOPAZ_EIGHTY
  1061.    dc.b   0,0
  1062.  
  1063.    XDEF   _audio_chan
  1064. _audio_chan: dc.b 3,5,10,12 ;Which audio channels to use
  1065.  
  1066. TalkPort:
  1067.           dc.l 0,0
  1068.           dc.b 4,0
  1069.           dc.l 0
  1070.           dc.b 0,-1        ;PA_SIGNAL,MP_SIGBIT
  1071.           dc.l 0
  1072. PortList1 dc.l PortList2
  1073. PortList2 dc.l 0
  1074. PortList3 dc.l PortList1
  1075.           dc.w 0
  1076.  
  1077. ReadPort:
  1078.           dc.l 0,0
  1079.           dc.b 4,0
  1080.           dc.l 0
  1081.           dc.b 0,-1        ;PA_SIGNAL,MP_SIGBIT
  1082.           dc.l 0
  1083. portList1 dc.l portList2
  1084. portList2 dc.l 0
  1085. portList3 dc.l portList1
  1086.           dc.w 0
  1087.  
  1088. ;===========Narrator Write Request block=============
  1089. VoiceIOB:
  1090.  ;---Embedded Message Structure
  1091.     dc.l  0,0
  1092.     dc.b  0,0
  1093.     dc.l  0
  1094.     dc.l  TalkPort       ;mn_ReplyPort 14(BASE)
  1095.     dc.w  70             ;mn_Length    18(BASE)
  1096.  ;---Embedded Expanded IORequest Structure
  1097. dev dc.l  0              ;io_Device    20(BASE)
  1098.     dc.l  0              ;io_Unit      24(BASE)
  1099.     dc.w  3              ;io_Command   28(BASE)
  1100.     dc.b  0              ;io_Flags     30(BASE)
  1101.     dc.b  0              ;io_Error     31(BASE)  SIGNED
  1102.     dc.l  0              ;io_Actual    32(BASE)
  1103.     dc.l  0              ;io_Length    36(BASE)
  1104.     dc.l  _PhonBuffer    ;io_Data      40(BASE)
  1105.     dc.l  0              ;io_Offset    44(BASE)
  1106.  ;---Narrator device additional fields
  1107.     dc.w  0              ;rb_rate      48(BASE)
  1108.     dc.w  0              ;rb_pitch     50(BASE)
  1109.     dc.w  0              ;rb_mode      52(BASE)
  1110.     dc.w  0              ;rb_pitch     54(BASE)
  1111.     dc.l  _audio_chan    ;rb_ch_masks  56(BASE)
  1112.     dc.w  4              ;rb_mn_masks  60(BASE)
  1113.     dc.w  0              ;rb_volume    62(BASE)
  1114.     dc.w  0              ;rb_sampfreq  64(BASE)
  1115.     dc.b  0              ;rb_mouths    66(BASE)
  1116.     dc.b  0              ;rb_chanmask  67(BASE) internal use
  1117.     dc.b  0              ;rb_numchan   68(BASE) internal use
  1118.     dc.b  0              ;Pad          69(BASE)
  1119.  
  1120. ;========Narrator Read Request block (used for the mouth)===========
  1121. ; The Read Request to the narrator has 4 additional bytes beyond the end
  1122. ; of the Write Request. They are:
  1123. ;   dc.b  0              ;rb_width     70(BASE)
  1124. ;   dc.b  0              ;rb_height    71(BASE)
  1125. ;   dc.b  0              ;rb_shape     72(BASE) internal use
  1126. ;   dc.b  0              ;Pad          73(BASE)
  1127. MouthIO: ds.b 74
  1128.  
  1129.    XDEF   _NarratorOpenError,_TranslatorError
  1130. _NarratorOpenError: dc.b -1     ;Narrator not yet opened (Flag)
  1131. _TranslatorError:   dc.b 0
  1132.  
  1133. _i dc.w 0
  1134.  
  1135. ;These are used to draw the eyes and mouth size relative
  1136. _MouthWMult   dc.w 0
  1137. _EyesLeft     dc.w 0
  1138. _MouthHMult   dc.w 0
  1139. _EyesTop      dc.w 0
  1140. _EyesBottom   dc.w 0
  1141. _YMouthCenter dc.w 0 ;Pixels from top edge
  1142. _XMouthCenter dc.w 0 ;Pixels from left edge
  1143. _yaw          dc.w 0
  1144. _LipWidth     dc.w 0
  1145. _LipHeight    dc.w 0
  1146.  
  1147. ;/* String Gadgets *********************************************
  1148. ;
  1149. ;First the string gadgets.
  1150. ;  1) because the Phonetic string is refreshed programaticly
  1151. ;  (that is, deleted and added again) quite often, and doing
  1152. ;  this requires the use of RefreshGadgets(), and this causes
  1153. ;  gadgets that are closer to the beginning of the list than
  1154. ;  the gadget given to RefreshGadgets() to flicker.
  1155. ;  2) because they don't flicker when OTHER gadgets
  1156. ;  (ie female/male, coming up) are deleted and added.
  1157. ;
  1158. ; These'll be used to put a nice double line border around
  1159. ; each of the two string gadgets.
  1160.  
  1161. ; y,x pairs drawn as a connected line. Be sure to have an even
  1162. ; number of arguments (ie complete pairs).
  1163.  
  1164.    XDEF   _StrVectors
  1165. _StrVectors:
  1166.    dc.w   0,0,297,0,297,14,0,14,0,1,296,1,296,13,1,13,1,1
  1167.  
  1168.    XDEF   _StrBorder
  1169. _StrBorder:
  1170.    dc.w   -4,-3       ;initial offsets, gadget relative
  1171.    dc.b   1,0         ;ForePen = 1, BackPen = 0
  1172.    dc.b   0           ;JAM1
  1173.    dc.b   9           ;number of vectors
  1174.    dc.l   _StrVectors ;pointer to the actual array of vectors
  1175.    dc.l   0           ;no Next Border
  1176.  
  1177. ; The same undo buffer is used for both string gadgets,
  1178. ; this is sized to largest so that largest fits.
  1179. _UndoBuffer ds.b 768
  1180.  
  1181. ; English String Gadget is where the user types in English
  1182.    XDEF   _EnglBuffer
  1183. _EnglBuffer:
  1184.    dc.b   'This is amiga speaking.',0
  1185.    ds.b   488
  1186.  
  1187.    XDEF   _EnglInfo
  1188. _EnglInfo:
  1189. ;pointer to I/O buffer
  1190.    dc.l   _EnglBuffer
  1191. ;pointer to undo buffer
  1192.    dc.l   _UndoBuffer
  1193. ;buffer position
  1194.    dc.w   0
  1195. ;max number of chars, including NULL
  1196.    dc.w   512
  1197. ;first char in display, undo positions
  1198.    dc.w   0
  1199.    dc.w   0
  1200. ;number of chars (currently) in the buffer
  1201.    dc.w   24
  1202. ;position variables calculated by Intuition
  1203.    dc.w   0,0,0
  1204. ;no pointer to RastPort
  1205.    dc.l   0
  1206. ;not a LongInt string gadget
  1207.    dc.l   0
  1208. ;no pointer to alternate keymap
  1209.    dc.l   0
  1210.  
  1211.    XDEF   _EnglText
  1212. _EnglText:
  1213. ;FrontPen, BackPen
  1214.    dc.b   1,0
  1215. ;DrawMode = JAM1, Pad
  1216.    dc.b   0,0
  1217. ;LeftEdge, TopEdge (relative to gadget)
  1218.    dc.w   0,-13
  1219. ;pointer to TextFont
  1220.    dc.l   TextAttr
  1221. ;pointer to Text
  1222.    dc.l   English
  1223. ;no pointer to NextText
  1224.    dc.l   0
  1225.  
  1226.    XDEF   _EnglStrGadget
  1227. _EnglStrGadget:
  1228. ;pointer to Next Gadget
  1229.    dc.l   0
  1230. ;(Left Top Width Height) Hit Box
  1231.    dc.w   11,63,290,10
  1232. ;   GADGHCOMP,        /* Flags */
  1233.    dc.w   0
  1234. ;   RELVERIFY,        /* Activation flags */
  1235.    dc.w   1
  1236. ;   STRGADGET,        /* Type */
  1237.    dc.w   4
  1238. ;pointer to Border Image
  1239.    dc.l   _StrBorder
  1240. ;no pointer to SelectRender
  1241.    dc.l   0
  1242. ;pointer to Gadget IntuiText
  1243.    dc.l   _EnglText
  1244. ;no MutualExclude
  1245.    dc.l   0
  1246. ;pointer to SpecialInfo
  1247.    dc.l   _EnglInfo
  1248. ;no ID
  1249.    dc.w   0
  1250. ;no pointer to special data
  1251.    dc.l   0
  1252.  
  1253. ; Phonetic string gadget is where the program puts the
  1254. ; translated string, necessating a call to RefreshGadgets(),
  1255. ; and is where the user can type in Phonemes.
  1256.  
  1257.    XDEF   _PhonBuffer
  1258. _PhonBuffer:
  1259.    dc.b  'DHIHS IHZ AHMIY3GAH SPIY4KIHNX.',0
  1260.    ds.b   736
  1261.  
  1262.    XDEF   _PhonInfo
  1263. _PhonInfo:
  1264.    dc.l   _PhonBuffer
  1265.    dc.l   _UndoBuffer
  1266.    dc.w   0,768,0,0,32,0,0,0
  1267.    dc.l   0
  1268. ;not a LongInt string gadget
  1269.    dc.l   0
  1270.    dc.l   0
  1271.  
  1272.    XDEF   _PhonText
  1273. _PhonText:
  1274.    dc.b   1,0,0,0
  1275.    dc.w   0,-13
  1276.    dc.l   TextAttr
  1277.    dc.l   Phonetic
  1278.    dc.l   0
  1279.  
  1280.    XDEF   _PhonStrGadget
  1281. _PhonStrGadget:
  1282.    dc.l   _EnglStrGadget
  1283.    dc.w   11,94,290,10,0,1,4
  1284.    dc.l   _StrBorder
  1285.    dc.l   0
  1286.    dc.l   _PhonText
  1287.    dc.l   0
  1288.    dc.l   _PhonInfo
  1289.    dc.w   0
  1290.    dc.l   0
  1291.  
  1292. ; Now come the Boolean Gadgets.
  1293. ; The female/male pair shows the simplest implementation I
  1294. ; could think of to show how you can do mutual-exclude type
  1295. ; things yourself. They are two toggle gadgets that use
  1296. ; highlight image. The program starts with one selected, and
  1297. ; then if either of them are hit, both toggle. Gadgets must
  1298. ; be deleted and added whenever you want to change structure
  1299. ; member values that intuition expects to be coming from the
  1300. ; user, not a program (like the SELECTED bit in flags). Note
  1301. ; that certain structure values CAN be changed programaticly
  1302. ; without all this broohaha. Haha. Consult the intuition manual.
  1303.  
  1304. ; Female Toggle (Highlight Image)
  1305. ; (Quasi mutual exclude with Male Toggle)
  1306.    XDEF   _FemaleImage
  1307. _FemaleImage:
  1308.    dc.w   0,0       ;Left,Top
  1309.    dc.w   20,10,1   ;Width, Height, Depth
  1310.    dc.l   $0000     ;ImageData (must be chip. Will be allocated)
  1311.    dc.b   1         ;PlanePick
  1312.    dc.b   0         ;PlaneOnOff
  1313.    dc.b   0,0,0,0
  1314.  
  1315.    XDEF   _FemaleGadget
  1316. _FemaleGadget:
  1317.    dc.l   _PhonStrGadget
  1318.    dc.w   134,34,20,10
  1319.   ;GADGIMAGE|GADGHCOMP
  1320.    dc.w   4
  1321.   ;Activation flags = RELVERIFY | GADGIMMEDIATE | TOGGLESELECT
  1322.    dc.w   259
  1323.    dc.w   1          ;Type = BOOLGADGET
  1324.    dc.l   _FemaleImage
  1325.    dc.l   0
  1326.    dc.l   0
  1327.    dc.l   0
  1328.    dc.l   0
  1329.    dc.w   0
  1330.    dc.l   0
  1331.  
  1332. ;Male Toggle (Highlight Image)
  1333. ;(Quasi mutual Exclude with above)
  1334.    XDEF   _MaleImage
  1335. _MaleImage:
  1336.    dc.w   0,0       ;Left,Top
  1337.    dc.w   20,10,1   ;Width, Height, Depth
  1338.    dc.l   $0000     ;ImageData
  1339.    dc.b   1         ;PlanePick
  1340.    dc.b   0         ;PlaneOnOff
  1341.    dc.b   0,0,0,0
  1342.  
  1343.    XDEF   _MaleGadget
  1344. _MaleGadget:
  1345.    dc.l   _FemaleGadget
  1346.    dc.w   154,34,20,10
  1347.   ;GADGIMAGE|GADGHCOMP|SELECTED
  1348.    dc.w   132
  1349.   ;Activation = RELVERIFY | GADGIMMEDIATE | TOGGLESELECT | ACTIVATE
  1350.    dc.w   4355
  1351.    dc.w   1
  1352.    dc.l   _MaleImage
  1353.    dc.l   0
  1354.    dc.l   0
  1355.    dc.l   0
  1356.    dc.l   0
  1357.    dc.w   0
  1358.    dc.l   0
  1359.  
  1360. ; This boolean toggle gadget has an
  1361. ; alternate image that indicates
  1362. ; selection. The image stays flipped
  1363. ; until it gets another hit. (it toggles)
  1364.  
  1365. ; Inflection Mode Toggle (AltImage)
  1366.  
  1367.    XDEF   _HumanImage
  1368. _HumanImage:
  1369.    dc.w   0,0,40,20,1
  1370.    dc.l   0
  1371.    dc.b   1,0,0,0,0,0
  1372.  
  1373.    XDEF   _RobotImage
  1374. _RobotImage:
  1375.    dc.w   0,0,40,20,1
  1376.    dc.l   0
  1377.    dc.b   1,0,0,0,0,0
  1378.  
  1379.    XDEF   _ModeGadget
  1380. _ModeGadget:
  1381.    dc.l   _MaleGadget
  1382.    dc.w   134,2,40,20
  1383. ;   GADGIMAGE | GADGHIMAGE, /* Flags */
  1384.    dc.w   6
  1385. ;   /* Activation flags */
  1386. ;   RELVERIFY | GADGIMMEDIATE | TOGGLESELECT,
  1387.    dc.w   259
  1388.    dc.w   1
  1389.    dc.l   _HumanImage
  1390.    dc.l   _RobotImage
  1391.    dc.l   0
  1392.    dc.l   0
  1393.    dc.l   0
  1394.    dc.w   0
  1395.    dc.l   0
  1396.  
  1397. ;Face Toggle (image and text)
  1398.  
  1399.    XDEF   _FaceIText
  1400. _FaceIText:
  1401.    dc.b   1,0,1,0
  1402.    dc.w   4,1
  1403.    dc.l   TextAttr
  1404.    dc.l   Face
  1405.    dc.l   0
  1406.  
  1407.    XDEF   _FaceImage
  1408. _FaceImage:
  1409.    dc.w   0,0,40,10,1
  1410.    dc.l   0
  1411.    dc.b   1,0,0,0,0,0
  1412.  
  1413.    XDEF   _FaceGadget
  1414. _FaceGadget:
  1415.    dc.l   _ModeGadget
  1416.    dc.w   134,23,40,10
  1417. ;   GADGIMAGE | GADGHCOMP,  /* Flags */
  1418.    dc.w   4
  1419. ;   /* Activation flags */
  1420. ;   RELVERIFY | GADGIMMEDIATE | TOGGLESELECT,
  1421.    dc.w   259
  1422.    dc.w   1
  1423.    dc.l   _FaceImage
  1424.    dc.l   0
  1425.    dc.l   _FaceIText
  1426.    dc.l   0
  1427.    dc.l   0
  1428.    dc.w   0
  1429.    dc.l   0
  1430.  
  1431. ;/* Stop Hit (image and text) ******************************/
  1432.    XDEF   _StopIText
  1433. _StopIText:
  1434.    dc.b   1,0,1,0
  1435.    dc.w   4,1
  1436.    dc.l   TextAttr
  1437.    dc.l   Stop
  1438.    dc.l   0
  1439.  
  1440.    XDEF   _StopImage
  1441. _StopImage:
  1442.    dc.w   0,0,40,10,1
  1443.    dc.l   0
  1444.    dc.b   1,0,0,0,0,0
  1445.  
  1446.    XDEF   _StopGadget
  1447. _StopGadget:
  1448.    dc.l   _FaceGadget
  1449.    dc.w   134,45,40,10
  1450. ;   GADGIMAGE | GADGHCOMP,  /* Flags */
  1451.    dc.w   4
  1452. ;   RELVERIFY | GADGIMMEDIATE, /* Activation flags */
  1453.    dc.w   3
  1454.    dc.w   1
  1455.    dc.l   _StopImage
  1456.    dc.l   0
  1457.    dc.l   _StopIText
  1458.    dc.l   0
  1459.    dc.l   0
  1460.    dc.w   0
  1461.    dc.l   0
  1462.  
  1463. ; This is a hit (as opposed to toggle)
  1464. ; gadget that starts the translation.
  1465. ; Translate Hit (Highlight image)
  1466.  
  1467.    XDEF   _TransVectors
  1468. _TransVectors:
  1469.    dc.w   0,0,79,0,79,13,0,13,0,1,78,1,78,12,1,12,1,1
  1470.  
  1471.    XDEF   _TransBorder
  1472. _TransBorder:
  1473.    dc.w   -4,-3
  1474.    dc.b   1,0,0,9
  1475.    dc.l   _TransVectors
  1476.    dc.l   0
  1477.  
  1478.    XDEF   _TranslateIText
  1479. _TranslateIText:
  1480.    dc.b   1,0,1,0
  1481.    dc.w   0,0
  1482.    dc.l   TextAttr
  1483.    dc.l   Translate
  1484.    dc.l   0
  1485.  
  1486.    XDEF   _TranslateGadget
  1487. _TranslateGadget:
  1488.    dc.l   _StopGadget
  1489.    dc.w   229,48,71,8
  1490.    dc.w   0,3,1
  1491.    dc.l   _TransBorder
  1492.    dc.l   0
  1493.    dc.l   _TranslateIText
  1494.    dc.l   0
  1495.    dc.l   0
  1496.    dc.w   0
  1497.    dc.l   0
  1498.  
  1499. ;/* This is a hit (as opposed to toggle) Starts the narration */
  1500. ;/* Speak Hit (Highlight Image) *******************************/
  1501.  
  1502.    XDEF   _SpeakVectors
  1503. _SpeakVectors:
  1504.    dc.w   0,0,47,0,47,13,0,13,0,1,46,1,46,12,1,12,1,1
  1505.  
  1506.    XDEF   _SpeakBorder
  1507. _SpeakBorder:
  1508.    dc.w   -4,-3
  1509.    dc.b   1,0,0,9
  1510.    dc.l   _SpeakVectors
  1511.    dc.l   0
  1512.  
  1513.    XDEF   _SpeakIText
  1514. _SpeakIText:
  1515.    dc.b   1,0,1,0
  1516.    dc.w   0,0
  1517.    dc.l   TextAttr
  1518.    dc.l   Speak
  1519.    dc.l   0
  1520.  
  1521.    XDEF   _SpeakGadget
  1522. _SpeakGadget:
  1523.    dc.l   _TranslateGadget
  1524.    dc.w   261,79,40,8,0,3,1
  1525.    dc.l   _SpeakBorder
  1526.    dc.l   0
  1527.    dc.l   _SpeakIText
  1528.    dc.l   0
  1529.    dc.l   0
  1530.    dc.w   0
  1531.    dc.l   0
  1532.  
  1533. ;==============PROPORTIONAL GADGETS==================
  1534.  
  1535. ;dummy AUTOKNOB Images are required
  1536. ;Image structures for 4 gadgets
  1537. PropImage0:
  1538.    dc.w   0,0,0,0,0
  1539.    dc.l   0
  1540.    dc.b   0,0,0,0,0,0
  1541. PropImage1:
  1542.    dc.w   0,0,0,0,0
  1543.    dc.l   0
  1544.    dc.b   0,0,0,0,0,0
  1545. PropImage2:
  1546.    dc.w   0,0,0,0,0
  1547.    dc.l   0
  1548.    dc.b   0,0,0,0,0,0
  1549. PropImage3:
  1550.    dc.w   0,0,0,0,0
  1551.    dc.l   0
  1552.    dc.b   0,0,0,0,0,0
  1553. PropImage19:
  1554.    dc.w   0,0,0,0,0
  1555.    dc.l   0
  1556.    dc.b   0,0,0,0,0,0
  1557.  
  1558.    XDEF   PropText0
  1559. PropText0:
  1560.    dc.b   1,0,0,0
  1561.    dc.w   0,-10
  1562.    dc.l   TextAttr
  1563.    dc.l   Sample
  1564.    dc.l   0
  1565. PropText1:
  1566.    dc.b   1,0,0,0
  1567.    dc.w   0,-10
  1568.    dc.l   TextAttr
  1569.    dc.l   Rate
  1570.    dc.l   0
  1571. PropText2:
  1572.    dc.b   1,0,0,0
  1573.    dc.w   0,-10
  1574.    dc.l   TextAttr
  1575.    dc.l   Pitch
  1576.    dc.l   0
  1577. PropText3:
  1578.    dc.b   1,0,0,0
  1579.    dc.w   0,-10
  1580.    dc.l   TextAttr
  1581.    dc.l   Volume
  1582.    dc.l   0
  1583.  
  1584.    XDEF   PropInfo0
  1585. PropInfo0:
  1586.    dc.w   3      ;AUTOKNOB|FREEHORIZ
  1587.    dc.w   49009,0
  1588. ;Bodies: Horiz is 1/8, Vert is 1/8
  1589.    dc.w   $1FFF
  1590.    dc.w   $1FFF
  1591.    dc.w   0,0,0,0,0,0
  1592. PropInfo1:
  1593.    dc.w   3,20024,0,$1FFF,$1FFF,0,0,0,0,0,0
  1594. PropInfo2:
  1595.    dc.w   3,11565,0,$1FFF,$1FFF,0,0,0,0,0,0
  1596. PropInfo3:
  1597.    dc.w   3,65535,0,$1FFF,$1FFF,0,0,0,0,0,0
  1598.  
  1599.    XDEF   PropGadget0
  1600. PropGadget0:
  1601.    dc.l   _SpeakGadget
  1602.    dc.w   7,12,115,10
  1603.    dc.w   4            ;GADGHCOMP|GADGIMAGE
  1604.    dc.w   3            ;GADGIMMEDIATE|RELVERIFY
  1605.    dc.w   3            ;PROPGADGET
  1606.    dc.l   PropImage0,0,PropText0,0,PropInfo0
  1607.    dc.w   0
  1608.    dc.l   0
  1609. PropGadget1:
  1610.    dc.l   PropGadget0
  1611.    dc.w   7,34,115,10,4,3,3
  1612.    dc.l   PropImage1,0,PropText1,0,PropInfo1
  1613.    dc.w   0
  1614.    dc.l   0
  1615. PropGadget2:
  1616.    dc.l   PropGadget1
  1617.    dc.w   190,12,115,10,4,3,3
  1618.    dc.l   PropImage2,0,PropText2,0,PropInfo2
  1619.    dc.w   0
  1620.    dc.l   0
  1621. PropGadget3:
  1622.    dc.l   PropGadget2
  1623.    dc.w   190,34,115,10,4,3,3
  1624.    dc.l   PropImage3,0,PropText3,0,PropInfo3
  1625.    dc.w   0
  1626.    dc.l   0
  1627.  
  1628.    XDEF   _IntuitionBase,_GfxBase,_TranslatorBase
  1629. _IntuitionBase:  dc.l 0
  1630. _GfxBase:        dc.l 0
  1631. _TranslatorBase: dc.l 0
  1632.  
  1633. ;==========Only one menu. (Goes on both Control and Face Windows)===========
  1634.  
  1635.    XDEF   MenuIntuiText
  1636. MenuIntuiText:
  1637.    dc.b   0,1,1,0
  1638.    dc.w   0,0
  1639.    dc.l   TextAttr,About,0
  1640.  
  1641.    XDEF   MenuItem0
  1642. MenuItem0:
  1643.    dc.l   0
  1644.    dc.w   0,0,150,8
  1645.    dc.w   $52       ;ITEMTEXT|ITEMENABLED|HIGHCOMP
  1646.    dc.l   0
  1647.    dc.l   MenuIntuiText
  1648.    dc.l   0
  1649.    dc.b   0,0
  1650.    dc.l   0
  1651.    dc.w   -1        ;NextSelect = MENUNULL
  1652.  
  1653.    XDEF   Menu0
  1654. Menu0:
  1655.    dc.l   0
  1656.    dc.w   0,0,150,0
  1657.    dc.w   1        ;MENUENABLED
  1658.    dc.l   SMenu
  1659.    dc.l   MenuItem0,0,0
  1660.  
  1661.    XDEF   _ReqText1
  1662. _ReqText1:
  1663.    dc.b   0,1,1,0
  1664.    dc.w   5,23
  1665.    dc.l   TextAttr
  1666.    dc.l   Version
  1667.    dc.l   0
  1668.  
  1669.    XDEF   _ReqText2
  1670. _ReqText2:
  1671.    dc.b   0,1,1,0
  1672.    dc.w   5,13
  1673.    dc.l   TextAttr
  1674.    dc.l   Free
  1675.    dc.l   _ReqText1
  1676.  
  1677.    XDEF   _ReqText3
  1678. _ReqText3:
  1679.    dc.b   0,1,1,0
  1680.    dc.w   5,3
  1681.    dc.l   TextAttr
  1682.    dc.l   Author
  1683.    dc.l   _ReqText2
  1684.  
  1685.    XDEF   _OKIText
  1686. _OKIText:
  1687.    dc.b   0,1,1,0
  1688.    dc.w   6,3
  1689.    dc.l   TextAttr
  1690.    dc.l   OK
  1691.    dc.l   0
  1692.  
  1693.    XDEF   _ControlWindow,_FaceWindow,RastPort
  1694. _ControlWindow: dc.l 0
  1695. _FaceWindow:    dc.l 0
  1696. RastPort        dc.l 0
  1697. _MyIntuiMessage dc.l 0
  1698.  
  1699.    XDEF   _NewControlWindow
  1700. _NewControlWindow:
  1701.    dc.w   0,11,321,123
  1702.    dc.b   -1,-1
  1703.    dc.l   $340     ;IDCMP = GADGETUP|CLOSEWINDOW|MENUPICK
  1704. ;WindowFlags = WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|GIMMEZEROZERO|ACTIVATE
  1705.    dc.l   $140e
  1706.    dc.l   PropGadget3
  1707.    dc.l   0
  1708.    dc.l   ST
  1709.    dc.l   0
  1710.    dc.l   0
  1711.    dc.w   20,20,321,123
  1712.    dc.w   1
  1713.  
  1714.    XDEF   _NewFaceWindow
  1715. _NewFaceWindow:
  1716.    dc.w   321,11,64,44
  1717.    dc.b   -1,-1
  1718.    dc.l   $103     ;IDCMP = SIZEVERIFY|NEWSIZE|MENUPICK
  1719. ; WINDOWDRAG|WINDOWDEPTH|WINDOWSIZING|SIZEBBOTTOM|GIMMEZEROZERO|ACTIVATE
  1720.    dc.l   $1427
  1721.    dc.l   0
  1722.    dc.l   0
  1723.    dc.l   Face
  1724.    dc.l   0
  1725.    dc.l   0
  1726.    dc.w   32,44,640,200
  1727.    dc.w   1
  1728.  
  1729.    XDEF   _FemaleIData
  1730. _FemaleIData:
  1731. ;   ----    -  These nibbles matter to image.
  1732.    dc.w   0,0,$F0,0,$198,0,$30C,0,$198,0,$F0,0,$60,0,$1F8,0,$60,0,0,0
  1733.  
  1734.    XDEF   _MaleIData
  1735. _MaleIData:
  1736.    dc.w   0,0,$3E,0,$E,0,$36,0,$1E0,0,$330,0,$618,0,$330,0,$1E0,0,0,0
  1737.  
  1738.    XDEF   _HumanIData
  1739. _HumanIData:
  1740. ;   ----   ----   --   These nibbles matter to image.
  1741.    dc.w   0,0,0,0,0,0,0,0,0,0,0,0,7,$9E00,0,1,$8600,0,0,0,0,0,0,0
  1742.    dc.w   0,$2000,0,0,$1000,0,0,$800,0,0,$7C00,0,0,0,0,0,0,0,0,0,0
  1743.    dc.w   0,$7800,0,0,0,0,0,0,0,0,0,0,0,0,0
  1744.  
  1745.    XDEF   _RobotIData
  1746. _RobotIData:
  1747. ;   ----   ----   --   These nibbles matter to image.
  1748.    dc.w   0,0,0,0,0,0,0,0,0,0,0,0,7,$9E00,0,4,$9200,0,7,$9E00,0,0,0,0
  1749.    dc.w   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,$F800,0,1,$800,0,1,$F800,0
  1750.    dc.w   0,0,0,0,0,0,0,0,0,0,0,0
  1751.  
  1752. English   dc.b 'English:',0
  1753. Phonetic  dc.b 'Phonetics:',0
  1754. Version   dc.b 'Version 1.1  21 Dec, 1985',0
  1755. Free      dc.b 'Freeware - Public Domain ',0
  1756. Author    dc.b 'Written by David M Lucas ',0
  1757. OK        dc.b 'OK',0
  1758. ST        dc.b 'SpeechToy',0
  1759. SMenu     dc.b 'SpeechToy Menu',0
  1760. About     dc.b 'About SpeechToy...',0
  1761. Speak     dc.b 'Speak',0
  1762. Translate dc.b 'Translate',0
  1763. Stop      dc.b 'Stop',0
  1764. Face      dc.b 'Face',0
  1765. Volume    dc.b 'Volume:',0
  1766. Pitch     dc.b 'Pitch:',0
  1767. Rate      dc.b 'Rate:',0
  1768. Sample    dc.b 'Sample Freq:',0
  1769. TopazName dc.b 'topaz.font',0
  1770. IntuitionTitle  dc.b 'intuition.library',0
  1771. GraphicsTitle   dc.b 'graphics.library',0
  1772. TranslatorTitle dc.b 'translator.library',0
  1773. Narrator        dc.b 'narrator.device',0
  1774.  
  1775.    END
  1776.